package com.alveole.events;


public class ServerEvent extends Event {


	public ServerEvent(){}
	public ServerEvent(String command, String target, String data)
	{
		super(command,target,data);
	}

	public String getJSON()
	{
		String json="";
		json+="{";
		json+=getJSONEntry("command",command) +",";
		json+=getJSONEntry("target",target) +",";
		json+=getJSONEntry("data",data);
		
		json+="}";
		
		return json;
	}
	public String getJSONEntry(String param, String value)
	{
		return getJSONParam(param) + getJSONValue(value);
	}
	public String getJSONParam(String param)
	{
		return quote(param)+":";
		
	}
	public String getJSONValue(String value)
	{
		return value;
		
	}
	public String quote(String value)
	{
		return "\""+ value+"\"";
	}
}
